﻿@model VIC.User.ViewModels.VIC_UserEditVM
@using Orchard.Media.Extensions;
@using Orchard.Media.Helpers;
@using Orchard.Media.Models;
@using (Html.BeginForm("EditUser", "Account", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    <div id="maincontainer">
        <main>
        <div id="profile">
            <table style="width:200px;">
                <tr>
                    <td><a href="~/"><img src="../../Content/images/icon_black.png"style="margin:0px 0px 40px"/></a></td>
                </tr>
                <tr>
                    <td style="width: 172px; height: 172px"><img src="@Model.Avatar" /></td>
                </tr>
            </table>
        </div>
        <div id="information"> 
            <div style="margin:0px 0px 40px"></div>
            <div style="font-size:22px;"> Upload hình ảnh</div>
            <br />
            <div> 
           
                <input id="MediaItemPath" name="MediaItemPath" type="file" value="@T("Browse")" size="64"/>
                <input type="hidden" id="FolderName" name="FolderName" value= @Model.FolderName />
                <input type="hidden" id="MediaPath" name="MediaPath" value= @Model.MediaPath />
                <br />
                <div>
                <p><button type = "submit" style="width: 70px" name="submit.Upload" value="Upload"> Upload </button></p>
                </div>
            </div>
             <br />
            <hr />
            <br /> 
             <div style="font-size:22px;">Thông tin cá nhân</div>
                <table style="width:500px">
                    <colgroup>
                        <col width="150px" />
                        <col width="350px" />
                    </colgroup>
                    <tr>
                        <td>Họ</td>
                        <td>@Html.TextBoxFor(model => model.FirstName, new { @class = "txttext" })</td>
                    </tr>
                    <tr>
                        <td>Tên</td>
                        <td>@Html.TextBoxFor(model => model.LastName, new { @class = "txttext" })</td>
                    </tr>
                     <tr>
                        <td>Giới tính</td>
                        <td style="padding-left: 20px">@Html.RadioButtonFor(model => model.Gender, "Nam", true) Nam  @Html.RadioButtonFor(model => model.Gender, "Nữ", false) Nữ</td>
                    </tr>
                     <tr>
                        <td>Ngày sinh</td>
                        <td>@*<select style="width:70px"></select> <select style="width:70px"></select><select style="width:100px"></select>*@
                        @*@Html.TextBox("DateOfBirth", @Model.DateOfBirth.Value.ToShortDateString(), new { id = "DateOfBirth", @class = "txttext" })*@
                        <select style="width: 70px" name="DayOfBirth" id ="DayOfBirth">

                        <option selected>@string.Empty</option>
                @for (int i = 1; i < 32; i++)
                {
                    if (@Model.DateOfBirth != null)
                    {
                        if (@Model.DateOfBirth.Value.Day == i)
                        {
                         <option selected>@i</option>
                        }
                        else
                        {
                         <option>@i</option> 
                        }
                    }
                    else
                    {
                         <option>@i</option>
                    }

                }
            </select>
            <select style="width: 70px" name="MonthOfBirth" id ="MonthOfBirth">
            <option selected>@string.Empty</option>
                @for (int i = 1; i <= 12; i++)
                {

                    if (@Model.DateOfBirth != null)
                    {
                        if (@Model.DateOfBirth.Value.Month == i)
                        {
                         <option selected>@i</option>
                        }
                        else
                        {
                         <option>@i</option> 
                        }
                    }
                    else
                    {
                         <option>@i</option>
                    }

                }
            </select>
            <select style="width: 100px" name="YearOfBirth" id = "YearOfBirth">
            <option selected>@string.Empty</option>
                @for (int i = DateTime.Now.Year - 80; i <= DateTime.Now.Year; i++)
                {

                    if (@Model.DateOfBirth != null)
                    {
                        if (@Model.DateOfBirth.Value.Year == i)
                        {
                         <option selected>@i</option>
                        }
                        else
                        {
                         <option>@i</option> 
                        }
                    }
                    else
                    {
                         <option>@i</option>
                    }

                }
            </select>
                        </td>
                    </tr> 
                </table>
                <hr />
                <br />
                <div style="font-size:22px;">Thông tin liên lạc</div>
                <table style="width:500px">
                    <colgroup>
                        <col width="150px" />
                        <col width="350px" />
                    </colgroup>
                    <tr>
                        <td>Địa chỉ Email</td>
                        <td>@Html.TextBoxFor(model => model.Email, new { @class = "txttext" })</td>
                    </tr>
                    <tr>
                        <td>CMND</td>
                        <td>@Html.TextBoxFor(model => model.SSN, new { @class = "txttext" })</td>
                    </tr>
                     <tr>
                        <td>Địa chỉ liên lạc</td>
                        <td>@Html.TextBoxFor(model => model.Address, new { @class = "txttext" })</td>
                    </tr>
                     <tr>
                        <td>Điện thoại</td>
                        <td>@Html.TextBoxFor(model => model.Phonenumber, new { @class = "txttext" })</td>
                    </tr> 
                </table>
                 <hr />
                <br />
                 <div style="font-size:22px;">Thông tin bổ sung</div>
                 <table style="width:500px">
                    <colgroup>
                        <col width="150px" />
                        <col width="350px" />
                    </colgroup>
                    <tr>
                        <td>Bạn quan tâm điều gì?</td>
                        <td>@Html.TextBoxFor(model => model.SummaryCare, new { @class = "txttext" })</td>
                    </tr>
                    <tr>
                        <td>Đôi nét về bản thân/ tổ chức</td>
                        <td> @Html.TextAreaFor(model => model.SummarySelf, new { Style = "width:355px; height:100px" })</td>
                    </tr>
                     <tr>
                        <td>Website/ Blog</td>
                        <td>@Html.TextBoxFor(model => model.Website, new { @class = "txttext" })</td>
                    </tr>
                </table>
            
                <button style="float:right; padding-left: 40px; padding-right:40px; margin:20px 20px 5px;" name="submit.LuuThayDoi" value="LuuThayDoi" class="btnSubmit">
                Lưu thay đổi</button>
            
        </div>
        
    </main>
    </div>
    @Html.AntiForgeryTokenOrchard()
}
@*@Html.ValidationSummary(T("Edit user information was unsuccessful. Please correct the errors and try again.").ToString())
@using (Html.BeginForm("EditUser", "Account", FormMethod.Post, new { enctype = "multipart/form-data" }))
{ 
    <legend>Chỉnh sửa thông tin cá nhân </legend> 
   <div class="sections clearBoth">
        <div class="primary">
            <div>
                <img src="@Model.Avatar" class="previewImage"/>
            </div>
        </div>
    </div>
    <div> Thay đổi avatar</div>
    <label for="pageTitle">@T("Đường dẫn tập tin")</label>
    <input id="MediaItemPath" name="MediaItemPath" type="file" value="@T("Browse")" size="64"/>
    <span class="hint">@T("Bạn có thể upload file hình với đuôi mở rộng: .jpg, .gif, .bmp.")</span>
    <input type="hidden" id="FolderName" name="FolderName" value= @Model.FolderName />
    <input type="hidden" id="MediaPath" name="MediaPath" value= @Model.MediaPath />
    <fieldset>
        <div class="editor-label">
            @Html.LabelFor(model => model.FirstName)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.FirstName)
        </div>

         <div class="editor-label">
            @Html.LabelFor(model => model.LastName)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.LastName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Gender)
        </div>
        <div class="editor-field">
            @Html.RadioButtonFor(model => model.Gender, "Male", true) Nam  @Html.RadioButtonFor(model => model.Gender, "Female", false) Nữ
            @Html.ValidationMessageFor(model => model.Gender)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.DateOfBirth)
        </div>
        <div class="editor-field">
           @Html.TextBox("DateOfBirth", @Model.DateOfBirth.Value.ToShortDateString(), new { id = "DateOfBirth" })
        @Html.ValidationMessageFor(model => model.DateOfBirth)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Email)
        </div>

        <div class="editor-field">
             @Html.TextBoxFor(model => model.Email, new { @readonly = true })
             @Html.ValidationMessageFor(model => model.Email)
        </div>



       <div class="editor-label">
        @Html.LabelFor(model => model.SSN)
    </div>
    <div class="editor-field">
        @Html.TextBoxFor(model => model.SSN)
        @Html.ValidationMessageFor(model => model.SSN)
    </div>
      <div class="editor-label">
        @Html.LabelFor(model => model.Address)
    </div>
    <div class="editor-field">
        @Html.TextBoxFor(model => model.Address)
        @Html.ValidationMessageFor(model => model.Address)
    </div>
    <div class="editor-label">
        @Html.LabelFor(model => model.Phonenumber)
    </div>
    <div class="editor-field">
        @Html.TextBoxFor(model => model.Phonenumber)
        @Html.ValidationMessageFor(model => model.Phonenumber)
    </div>
    <div class="editor-label">
        @Html.LabelFor(model => model.SummaryCare)
    </div>
    <div class="editor-field">
        @Html.TextAreaFor(model => model.SummaryCare)
        @Html.ValidationMessageFor(model => model.SummaryCare)
    </div>
    <div class="editor-label">
        @Html.LabelFor(model => model.SummarySelf)
    </div>
    <div class="editor-field">
        @Html.TextAreaFor(model => model.SummarySelf)
        @Html.ValidationMessageFor(model => model.SummarySelf)
    </div>
    <div class="editor-label">
        @Html.LabelFor(model => model.Website)
    </div>
    <div class="editor-field">
        @Html.TextBoxFor(model => model.Website)
        @Html.ValidationMessageFor(model => model.Website)

    </div>

    @Html.HiddenFor(model => model.IdUser)
        <div class="editor-field">
            <div>
                <button class="primaryAction" type="submit" id="btn">@T("Lưu thay đổi")</button>
            </div>
            @Html.AntiForgeryTokenOrchard()
        </div>
    </fieldset>
}
*@
@using (Script.Foot())
{
    <script src="/OrchardLocal/Modules/Orchard.jQuery/Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>    
    <script src="/OrchardLocal/Modules/Orchard.jQuery/Scripts/jquery.ui.datepicker.min.js"
        type="text/javascript"></script>
    <script src="/OrchardLocal/Modules/Orchard.jQuery/Scripts/jquery.ui.datepicker-vi.js"
        type="text/javascript"></script>
    <script src="/OrchardLocal/Modules/Orchard.jQuery/Scripts/jquery-ui-1.9.1.custom.js"
        type="text/javascript"></script>
    <script src="/OrchardLocal/Modules/TinyMce/Scripts/tiny_mce_src.js" type="text/javascript"></script>
    <script src="/OrchardLocal/Modules/TinyMce/Scripts/orchard-tinymce.js" type="text/javascript"></script>
    <link href="/OrchardLocal/Modules/Orchard.jQuery/Styles/jquery-ui.css" rel="stylesheet"
        type="text/css" />
    


    <script type="text/javascript">
        $(function () {
            $("#DateOfBirth").datepicker($.datepicker.regional['vi']);
        });
    </script>
    
}
@*@using (Script.Foot())
{
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    
    <link rel="stylesheet" type="text/css" href="css/jquery.datepick.css"/> 
    <script type="text/javascript" src="js/jquery.datepick.js"></script>
        <script type="text/javascript">
            $(function () {
                $("#DateOfBirth").datepick({dateFormat: 'yyyy-mm-dd'});
            });
    </script>
}*@